package com.ruoyi.project.module.purchases.mapper;

import com.ruoyi.project.module.products.domain.Products;
import com.ruoyi.project.module.purchases.domain.Purchases;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 国内采购 数据层
 * 
 * @author lcx
 * @date 2018-09-05
 */
public interface PurchasesMapper 
{
	/**
     * 查询国内采购信息
     * 
     * @param id 国内采购ID
     * @return 国内采购信息
     */
	public Purchases selectPurchasesById(Integer id);

	/**
     * 查询国内采购列表
     * 
     * @param purchases 国内采购信息
     * @return 国内采购集合
     */
	public List<Purchases> selectPurchasesList(Purchases purchases);

	/**
	 * @Author lcx
	 * @Date 2018/9/28 9:45
	 * 发往海外仓查询
	 */
	public List<Purchases> selectPurchasesOverseasList(Purchases purchases);

    /**
     * @Author lcx
     * @Date 2018/9/10 13:55
     * 查询海外仓签收
     */
    List<Purchases> selectPurchasesListAsReceived(Purchases purchases);


    /**
     * 新增国内采购
     * 
     * @param purchases 国内采购信息
     * @return 结果
     */
	public int insertPurchases(Purchases purchases);
	
	/**
     * 修改国内采购
     * 
     * @param purchases 国内采购信息
     * @return 结果
     */
	public int updatePurchases(Purchases purchases);
	
	/**
     * 删除国内采购
     * 
     * @param id 国内采购ID
     * @return 结果
     */
	public int deletePurchasesById(Integer id);
	
	/**
     * 批量删除国内采购
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	public int deletePurchasesByIds(String[] ids);

	/**
	 * @Author lcx
	 * @Date 2018/9/9 16:47
	 * 查询批量打印标签
	 */
	Purchases selectProductAsPrinsetLabel(String id);

	/**
	 * @Author lcx
	 * @Date 2018/9/9 16:47
	 * 国内采购单个查询搜索
	 */

	List<Purchases> selectPurchasesListAsSearchRow(@Param("products") Purchases products, @Param("searchRow") String[] searchRow);

	/**
	 * @Author lcx
	 * @Date 2018/9/28 9:44
	 * 查询发往海外仓多个搜索
	 */
	List<Purchases> selectPurchasesOverseasListAsSearchRow(@Param("products") Purchases products, @Param("searchRow") String[] searchRow);

	/**
	 * @Author lcx
	 * @Date 2018/9/9 16:47
	 * 海外仓签收多个查询
	 */
	List<Purchases> selectPurchasesListReceivedAsSearchRow(@Param("products") Purchases purchases, @Param("searchRow") String[] searchRow);

	/*合计国内采购*/
	List<Purchases> selectPurchasesListAsSum(Purchases purchases);
	/*合计国内采购多个搜索*/
	List<Purchases> selectPurchasesListAsSearchRowAsSum(@Param("products") Purchases products, @Param("searchRow") String[] searchRow);

	/*合计发往海外仓*/
	List<Purchases> selectPurchasesOverseasListAsSum(Purchases purchases);
	/*合计发往海外仓多个搜索*/
	List<Purchases> selectPurchasesOverseasListAsSearchRowAsSum(@Param("products") Purchases products, @Param("searchRow") String[] searchRow);

    /*海外仓签收 合计*/
    List<Purchases> selectPurchasesListAsReceivedAsSum(Purchases purchases);
	/*海外仓签收 搜索合计*/
	List<Purchases> selectPurchasesListReceivedAsSearchRowAsSum(@Param("products") Purchases purchases, @Param("searchRow") String[] searchRow);
	/*查询发货表的 sku 通过 打印生成的 位于标识  生成方式为 创建时间戳 + id + 行号 此sql 判断了如果采购数量是两位数 那么就截取掉后面两位 一位则截取一位*/
    Purchases selectPurchasesBySweepCodeId(String stid);
}